package at.ltasat.classifier;

import java.util.Arrays;

public final class ObjectFeatures {
	private final double[] values;

	public ObjectFeatures(double[] values) {
		this.values = values.clone();
	}

	public int getNumberOfFeatures() {
		return values.length;
	}

	public double getFeatureValue(int featureIndex) {
		return values[featureIndex];
	}

	public double[] toArray() {
		return values.clone();
	}

	@Override
	public int hashCode() {
		return Arrays.hashCode(values);
	}

	@Override
	public boolean equals(Object other) {
		if (other instanceof ObjectFeatures) {
			return Arrays.equals(values, ((ObjectFeatures) other).values);
		}
		return false;
	}

	@Override
	public String toString() {
		return Arrays.toString(values);
	}
}
